home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
snip9_91.arc
/
SCRNSIZE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-17
|
452b
|
26 lines
/*
** Get screen size (by Bob Jarvis)
*/
#include <dos.h>
int get_screen_rows(void)
{
char far *bios_crt_rows_ptr = MK_FP(0x0040, 0x0084);
return(*bios_crt_rows_ptr);
}
int get_screen_cols(void)
{
int far *bios_crt_cols_ptr = MK_FP(0x0040, 0x004A);
return(*bios_crt_cols_ptr);
}
main()
{
printf("rows = %d cols = %d\n",
get_screen_rows(), get_screen_cols());
}